package com.foreknow.demo06;

public class Rectangle {
  int length;
  int width;

  public Rectangle(int length, int width) {
    this.length = length;
    this.width = width;
  }

  public int getArea() {
    int area = length * width;
    return area ;
  }

  public int getPer() {
    int per = 2*(length+width);
    return per;
  }

  public void showAll() {
    System.out.println("长为"+length+",宽为"+width+",面积为"+getArea()+",周长为"+getPer());
  }

  public static void main(String[] args) {
    Rectangle rectangle = new Rectangle(2,3);
    rectangle.showAll();
  }
}
